#ifndef XDEMUX_TASK_H
#define XDEMUX_TASK_H
#include "xdemux.h"
#include "xtools.h"
class XDemuxTask : public XThread {
public:
  XDemuxTask() = default;
  // 打开解封装，并设置超时时间（默认为1ms）
  bool Open(const std::string &url, int timeout_ms = 1000);
  /// @brief CopyVideoPara 拷贝视频参数
  std::shared_ptr<XPara> CopyVideoPara() { return demux_.CopyVideoPara(); }
  std::shared_ptr<XPara> CopyAudioPara() { return demux_.CopyAudioPara(); }

protected:
  void Main() override;

private:
  XDemux demux_;
  std::string url_;
  int timeout_ms_ = 0;
};

#endif // XDEMUX_TASK_H
